﻿@namespace Masa.Blazor
@inherits MGroupItem<Masa.Blazor.Components.ItemGroup.MItemGroupBase>

@if (IsBooted || IsEager)
{
    <Transition Name="@ComputedTransition"
                OnBeforeEnter="HandleOnBefore"
                OnAfterEnter="HandleOnAfter"
                OnBeforeLeave="HandleOnBefore"
                OnAfterLeave="HandleOnAfter"
                OnEnter="HandleOnEnter">
        <ShowTransitionElement Value="@InternalIsActive"
                               class="@GetClass()"
                               style="@GetStyle()"
                               id="@Id"
                               ReferenceCaptureAction="r => Ref = r"
                               Tag="@Tag"
                               @attributes="@Attributes">
            <MShouldRender Value="@InternalIsActive">
                @GenChildContent()
            </MShouldRender>
        </ShowTransitionElement>
    </Transition>
}

@code {

    protected virtual RenderFragment? GenChildContent() => ChildContent;

}